const logger = require('../../utils/log');
const http = require('http');
const https = require('https');

const server = http.createServer((request, response) => {
    https.get('https://gitee.com/api/v3/internal/my_resources', (resolve) => {
        logger.debug(resolve);
        let data = '';
        resolve.on('data', (chunk) => {
            data += chunk;
        })
        resolve.on('end', () => {
            response.writeHead(200, {
                'Content-Type': 'application/json;charset=utf-8'
            })
            response.write(data);
            response.end();
        })
    })
    
})

server.listen(8080, () => {
    console.log('localhost:8080');
})